package com.conversationboard.controller.reindexer;

import java.io.IOException;
import java.sql.SQLException;
import java.util.Date;

import com.conversationboard.fulltext.index.IndexNewDocuments;
import com.conversationboard.logger.LogMessageType;
import com.conversationboard.logger.Logger;

/** Recreate the entire index on a separate thread */

public class RecreateIndex implements Runnable {

	public void run() {

		try {
			IndexNewDocuments indexer = new IndexNewDocuments();
			indexer.reindexAllDocuments();
		} catch (SQLException e) {
			Logger.log(new Date(), "Recreate Index: " + e.getMessage(), null, LogMessageType.SYSTEM);
		} catch (IOException e) {
			Logger.log(new Date(), "Recreate Index: " + e.getMessage(), null, LogMessageType.SYSTEM);
		}

	}

}
